package com.fang.strategy;

import org.springframework.stereotype.Component;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2022/4/22 4:13 下午
 **/
@Component
public class AddNumStrategy implements CalcNumStrategy {
    /**
     * 是否支持
     *
     * @param calcType 计算类型枚举
     * @return boolean
     * @author fanglingxiao
     * @createDateTime 2022/4/22 4:26 下午
     */
    @Override
    public boolean support(CalcTypeEnum calcType) {
        return CalcTypeEnum.ADD.equals(calcType);
    }

    /**
     * 计算
     *
     * @param a 常量a
     * @param b 常量b
     * @return int
     * @author fanglingxiao
     * @createDateTime 2022/4/22 4:28 下午
     */
    @Override
    public int calc(int a, int b) {
        return a + b;
    }
}
